@import "../../themes/ionic.globals.wp";

// Windows Label
// --------------------------------------------------

/// @prop - Text color of the label by an input, select, or datetime
$label-wp-text-color:                 #999 !default;

/// @prop - Text color of the stacked/floating label when it is focused
$label-wp-text-color-focused:         color($colors-wp, primary) !default;


// Windows Default Label
// --------------------------------------------------

.label-wp {
  @include margin($item-wp-padding-top, ($item-wp-padding-end / 2), $item-wp-padding-bottom, 0);
}


// Windows Default Label Inside An Input/Select Item
// --------------------------------------------------

.item-input .label-wp,
.item-select .label-wp,
.item-datetime .label-wp {
  color: $label-wp-text-color;
}


// Windows Stacked & Floating Labels
// --------------------------------------------------

.label-wp[stacked] {
  font-size: 1.2rem;
}

.label-wp[floating] {
  @include transform(translate3d(8px, 34px, 0));
  @include transform-origin(start, top);
}

.label-wp[stacked],
.label-wp[floating] {
  @include margin(null, null, 0, 0);
}

// TODO remove all uses of input-has-focus in v4
// TODO remove all uses of input-has-value in v4
.item-input-has-focus .label-wp[stacked],
.input-has-focus .label-wp[stacked],
.item-input-has-focus .label-wp[floating],
.input-has-focus .label-wp[floating] {
  color: $label-wp-text-color-focused;
}

.item-input-has-focus .label-wp[floating],
.input-has-focus .label-wp[floating],
.item-input-has-value .label-wp[floating],
.input-has-value .label-wp[floating] {
  @include transform(translate3d(0, 0, 0), scale(.8));
}

.item-wp.item-label-stacked [item-right], // deprecated
.item-wp.item-label-floating [item-right], // deprecated
.item-wp.item-label-stacked [item-end],
.item-wp.item-label-floating [item-end] {
  @include margin($item-wp-padding-media-top + 4, null, $item-wp-padding-media-top + 4, null);
}


// Generate Windows Label colors
// --------------------------------------------------

@each $color-name, $color-base, $color-contrast in get-colors($colors-wp) {

  .label-wp-#{$color-name},
  .item-input .label-wp-#{$color-name},
  .item-select .label-wp-#{$color-name},
  .item-datetime .label-wp-#{$color-name} {
    color: $color-base;
  }

}
